<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>列表</title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">

            <div class="layui-form-item">
                <form name="totalForm" id="totalForm" action="${web_domain}/mall/groupBooking/order/list" method="get">

                    <div class="layui-inline">
                        <label class="layui-form-label">拼团编号</label>
                        <div class="layui-input-inline">
                            <input type="text" name="orderNo" placeholder="请输入拼团编号" value="<c:if test='${params.orderNo !=null}'>${params.orderNo}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">商品名称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="sku.goods.name" placeholder="请输入商品名称" value="<c:if test='${params.sku.goods.name !=null}'>${params.sku.goods.name}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <%--<div class="layui-inline">--%>
                        <%--<label class="layui-form-label">商家名称</label>--%>
                        <%--<div class="layui-input-inline">--%>
                            <%--<input type="text" name="merchant.shopName" placeholder="请输入商家名称" value="<c:if test='${params.merchant.shopName !=null}'>${params.merchant.shopName}</c:if>" autocomplete="off" class="layui-input">--%>
                        <%--</div>--%>
                    <%--</div>--%>

                    <div class="layui-inline">
                        <label class="layui-form-label">团长昵称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="groupBooking.member.nickname" placeholder="请输入团长昵称" value="<c:if test='${params.groupBooking.member.nickname !=null}'>${params.groupBooking.member.nickname}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">参团昵称</label>
                        <div class="layui-input-inline">
                            <input type="text" name="member.nickname" placeholder="请输入团长昵称" value="<c:if test='${params.member.nickname !=null}'>${params.member.nickname}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">参团手机号</label>
                        <div class="layui-input-inline">
                            <input type="text" name="member.mobile" placeholder="请输入团长昵称" value="<c:if test='${params.member.mobile !=null}'>${params.member.mobile}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>


                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-sm layuiadmin-btn-list" id="search"><i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> 搜索</button>
                    </div>
                </form>
            </div>
        </div>

    </div>

    <div class="layui-card">
        <div class="layui-field-box layui-form">

            <table class="layui-table" lay-size="sm">
                <thead>
                <th>序号</th>
                <th>拼团编号</th>
                <th>商家名称</th>
                <th>商品名称</th>
                <th>拼团价格</th>
                <th>团长昵称</th>
                <th>参团昵称</th>
                <th>参团手机号</th>
                <th>参团时间</th>
                <th>是否成团</th>
                </thead>
                <c:forEach items="${page.result}" var="item" varStatus="status">
                    <tr>
                        <td>${status.index + 1}</td>
                        <td>${item.orderNo }</td>
                        <td>${item.merchant.shopName }</td>
                        <td>${item.sku.goods.name }</td>
                        <td>${item.sku.groupBookingPrice }</td>
                        <td>${item.groupBooking.member.nickname }</td>
                        <td>${item.member.nickname }</td>
                        <td>${item.member.mobile }</td>
                        <td><fmt:formatDate value="${item.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                        <td>${(item.groupBooking.groupBookingTotal ==  item.groupBooking.groupBookingCondition) ? '是' : '否'}</td>
                        <%--<td>--%>
                            <%--<div class="layui-btn-container">--%>
                                <%--<a href="javascript:void(0);" data-id="${item.id}" class="layui-btn layui-btn-xs feijin-detail">查看</a>--%>
                            <%--</div>--%>
                        <%--</td>--%>
                    </tr>
                </c:forEach>
            </table>
            <jsp:include page="/commons/page.jsp" flush="true"/>
        </div>
    </div>

</div>

<script>

    $(function () {

        layui.use(['form', 'laydate'], function () {

            var form = layui.form;
            var laydate = layui.laydate;


            //查看详情
            $(".feijin-detail").click(function () {

                var id = $(this).attr("data-id");

                layer.open({
                    type: 2
                    , title: '查看详情'
                    , content: '${web_domain}/mall/groupBooking/open/' + id + '/detail'
                    , maxmin: true
                    , area: ['97%', '97%']
                    , btn: ['返回']
                });
            });

        });
    });
</script>
</body>
</html>
